package com.yanmaohu.yulia.bean;

/**
 * @author Bright Lee
 */
public final class StaticMethodInvocation implements NonparenthesizedValueExpressionPrimary {

    private int beginIndex;
    private int endIndex;
    private SchemaQualifiedName pathResolvedUserDefinedTypeName;
    private Identifier methodName;
    private SqlArgumentList sqlArgumentList;

    public StaticMethodInvocation(SchemaQualifiedName pathResolvedUserDefinedTypeName,
                                  Identifier methodName,
                                  SqlArgumentList sqlArgumentList) {
        this.beginIndex = pathResolvedUserDefinedTypeName.getBeginIndex();
        this.endIndex = sqlArgumentList != null ? sqlArgumentList.getEndIndex() : methodName.getEndIndex();
        this.pathResolvedUserDefinedTypeName = pathResolvedUserDefinedTypeName;
        this.methodName = methodName;
        this.sqlArgumentList = sqlArgumentList;
    }

    @Override
    public int getBeginIndex() {
        return beginIndex;
    }

    @Override
    public int getEndIndex() {
        return endIndex;
    }

    public SchemaQualifiedName getPathResolvedUserDefinedTypeName() {
        return pathResolvedUserDefinedTypeName;
    }

    public Identifier getMethodName() {
        return methodName;
    }

    public SqlArgumentList getSqlArgumentList() {
        return sqlArgumentList;
    }

}
